package com.day02;

public class Lambda {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String msg) {
                System.out.println("搞学习");
            }
        });

        useStringHandler((String st) -> {
                    System.out.println("lambda表达式");
                }
        );
    }

    public static void useStringHandler(StringHandler st) {
        st.printMessage("无聊");
    }

    interface StringHandler {
        void printMessage(String msg);
    }
}
